<template>
  <div class="" style="" v-if="!isShow">
    <div class="errPage-container">
      <el-button icon="arrow-left" class="pan-back-btn" @click="back">
        返回
      </el-button>
      <el-row>
        <el-col :span="12">
          <h1 class="text-jumbo text-ginormous">401错误!</h1>
          <h2>您没有访问权限！</h2>
          <h6>对不起，您没有访问权限，请不要进行非法操作！您可以返回主页面</h6>
          <ul class="list-unstyled">
            <li class="link-type">
              <router-link to="/">回首页</router-link>
            </li>
          </ul>
        </el-col>
        <el-col :span="12">
          <img
            @click="transformStatus"
            :src="errGif"
            width="313"
            height="428"
            alt="Girl has dropped her ice cream."
          />
        </el-col>
      </el-row>
    </div>
  </div>
  <div class="small-container" v-else>
    <div
      class=""
      style="
        width: 100%;
        height: 100vh;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
      "
    >
      <div
        class=""
        style="
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          width: 98px;
          height: 98px;
          margin: 10px;
        "
        v-for="(item, index) in svgArr"
        :key="index"
        @click="copyText(item)"
      >
        <svg-icon :icon-class="item" style="width: 60px; height: 60px" />
        <span style="width: 100%; text-align: center">{{ item }}</span>
      </div>
    </div>
  </div>
</template>

<script>
/* 
<svg-icon
          :icon-class="value == 1 ? 'triangle-s' : 'triangle-e'"
        ></svg-icon>
 */
import errGif from '@/assets/404_images/401.gif';

export default {
  name: 'Page401',
  data() {
    return {
      isShow: true,
      errGif: errGif + '?' + +new Date(),
      svgArr: [
        '404',
        'aqhlgz',
        'bug',
        'c-cascader',
        'c-checkbox',
        'c-datePicker',
        'c-file',
        'c-input',
        'c-photo',
        'c-radio',
        'c-select',
        'c-textarea',
        'cd',
        'cfkgm',
        'chart-dots',
        'check',
        'clipboard',
        'config',
        'cs',
        'dashboard',
        'dd',
        'ddcrt',
        'ddyc',
        'devices-info',
        'door-c',
        'door-o',
        'dtqhqx',
        'dttd',
        'dtzd',
        'dtzyqx',
        'elevator-da',
        'elevator-pg',
        'elevator',
        'email',
        'excel',
        'exit',
        'file-blue',
        'file-cut',
        'file-index',
        'file-info',
        'file-invoice',
        'file-reco',
        'file-tag',
        'file',
        'fullscreen',
        'gmgz',
        'gr',
        'icon',
        'jsdyc',
        'kc',
        'kmgz',
        'kmzt',
        'layout-grid-check',
        'layout-grid',
        'list-check',
        'list-normal',
        'material',
        'menu-bgsc',
        'menu-dtbx',
        'menu-dtda',
        'menu-dtnj',
        'menu-dtpg',
        'menu-dtrc',
        'menu-dtwb',
        'menu-dtyx',
        'menu-gzpj',
        'menu-jxgz',
        'menu-sjjc',
        'menu-xtgl',
        'menu-xtzz',
        'menu-yjjy',
        'menu-zdsb',
        'ms',
        'process',
        'risk_A',
        'risk_B',
        'risk_C',
        'risk_D',
        'risk_E',
        'sdbj',
        'search',
        'secure0',
        'secure1',
        'secure2',
        'secure3',
        'secure4',
        'setting-new',
        'setting',
        'skin',
        'space',
        'statistics',
        'tab',
        'table',
        'top1',
        'top2',
        'top3',
        'tree',
        'triangle-e',
        'triangle-s',
        'tt',
        'user'
      ]
    };
  },
  computed: {},
  created() {
    this.isShow = process.env.NODE_ENV == 'development';
  },
  methods: {
    copyText(text) {
      navigator.clipboard
        .writeText(text)
        .then(() => {
          console.log('Text successfully copied to clipboard');
        })
        .catch(err => {
          console.error('Could not copy text: ', err);
        });
    },
    transformStatus() {
      this.isShow = true;
    },
    back() {
      if (this.$route.query.noGoBack) {
        this.$router.push({ path: '/' });
      } else {
        this.$router.go(-1);
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.errPage-container {
  width: 800px;
  max-width: 100%;
  margin: 100px auto;
  .pan-back-btn {
    background: #008489;
    color: #fff;
    border: none !important;
  }
  .pan-gif {
    margin: 0 auto;
    display: block;
  }
  .pan-img {
    display: block;
    margin: 0 auto;
    width: 100%;
  }
  .text-jumbo {
    font-size: 60px;
    font-weight: 700;
    color: #484848;
  }
  .list-unstyled {
    font-size: 14px;
    li {
      padding-bottom: 5px;
    }
    a {
      color: #008489;
      text-decoration: none;
      &:hover {
        text-decoration: underline;
      }
    }
  }
}
</style>
